﻿<!DOCTYPE html>
@{
    var checkSession = "";
    if (this.Session["Account"] != null)
    {
        checkSession = this.Session["Account"].ToString().Trim();
    }
    
}
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>@ViewBag.Title</title>
    <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    <link href="~/css/metro-bootstrap.css" rel="stylesheet" />
    <link href="~/css/own.css" rel="stylesheet" />
    <script src="~/js/jquery.min.js"></script>
    <script src="~/js/jquery.widget.min.js"></script>
    <script src="~/js/metro.min.js"></script>
    <script src="~/js/own.js"></script>
</head>
<body>
    <div class="metro">
        <ul style="list-style-type: none; margin: 0; padding: 2px 0px 2px 0px; background-color: black;">
            <li style="display: inline-block; width: 85%"></li>
            @if (this.Session["Account"] != null)
            {
              
                <li style="display: inline-block; width: 10%; text-align: center; vertical-align: middle; color: wheat">
                    @this.Session["Account"]
                </li>
                if (this.Session["RoleName"] != null && this.Session["RoleName"].ToString().Trim() == "Staff" || this.Session["RoleName"].ToString().Trim() == "Admin")
                {
                @*<li style="display: inline-block; width: 7%; text-align: center; vertical-align: middle;">
                    <a class="dropdown-toggle" href="#" style="padding: 8px; border-radius: 3px; font-size: 15px; color: white"><span class="icon-warning">(4)</span></a>
                    <ul class="dropdown-menu drop-left" data-role="dropdown" style="background-color: transparent; text-align: left; padding-left: 5px; border-color: transparent">
                        <div class="balloon bottom">
                            <li>Noah 15000đ</li>
                            <li>Americe... 25000đ</li>
                        </div>
                    </ul>
                </li>*@
                }
                <li style="display: inline-block; width: 3%; text-align: center; vertical-align: middle">
                    <a class="dropdown-toggle" href="#" style="display: block; padding: 8px; border-radius: 3px; font-size: 15px; color: white"><span class="icon-cog"></span></a>
                    @if (this.Session["RoleName"] != null && this.Session["RoleName"].ToString().Trim() == "Staff")
                    {
                        <ul class="dropdown-menu drop-own" data-role="dropdown" style="text-align: left; padding-left: 5px">
                            <li><a href="/Staff/Profile">Thông tin cá nhân</a></li>
                            <li><a href="/User/ChangePassword">Thay đổi mật khẩu</a></li>
                            <li><a href="#" onclick=" LogOut() ">Đăng xuất</a></li>
                        </ul>
                    }
                    @if (this.Session["RoleName"] != null && this.Session["RoleName"].ToString().Trim() == "Supplier")
                    {
                        <ul class="dropdown-menu drop-own" data-role="dropdown" style="text-align: left; padding-left: 5px">
                            <li><a href="/Supplier/Profile">Thông tin cá nhân</a></li>
                            <li><a href="/User/ChangePassword">Thay đổi mật khẩu</a></li>
                            <li><a href="#" onclick=" LogOut() ">Đăng xuất</a></li>
                        </ul>
                    }
                    @if (this.Session["RoleName"] != null && this.Session["RoleName"].ToString().Trim() == "Admin")
                    {
                        <ul class="dropdown-menu drop-own" data-role="dropdown" style="text-align: left; padding-left: 5px">
                            @*<li><a href="/Admin/Profile">Thông tin cá nhân</a></li>*@
                            <li><a href="/User/ChangePassword">Thay đổi mật khẩu</a></li>
                            <li><a href="#" onclick=" LogOut() ">Đăng xuất</a></li>
                        </ul>
                    }


                </li> 
            }
        </ul>
        <input type="hidden" id="txtCheckSession" name="txtCheckSession" value="@checkSession"/>
        <div style="display: inline-block; width: 20%">
            @if (this.Session["RoleName"] != null && this.Session["RoleName"].ToString().Trim() == "Staff")
            {
                @Html.Partial("~/Views/Shared/_Staffmenu.cshtml")
            }
            @if (this.Session["RoleName"] != null && this.Session["RoleName"].ToString().Trim() == "Supplier")
            {
                @Html.Partial("~/Views/Shared/_Suppliermenu.cshtml")
            }
            @if (this.Session["RoleName"] != null && this.Session["RoleName"].ToString().Trim() == "Admin")
            {
                @Html.Partial("~/Views/Shared/_Admenu.cshtml")
            }
        </div>

        <div style="display: inline-block; width: 77%; vertical-align: top">
            @RenderBody()
        </div>
    </div>
    <style>
        .dropdown-toggle:hover {
            color: rgba(233, 230, 230, 0.8);
            background-color: #C04944;
        }

        .dropdown-menu dark:hover {
            display: normal;
        }

        .cut {
        }
    </style>
    <!--Reference the SignalR library. -->
    <script src="~/Scripts/jquery.signalR-2.0.3.min.js"></script>
    <!--Reference the autogenerated SignalR hub script. -->
    <script src="~/signalr/hubs"></script>
    <!--Add script to update the page and send messages.-->
    <script type="text/javascript">
        $(function () {
            // Declare a proxy to reference the hub. 
            var notification = $.connection.notificationHub;
            // Create a function that the hub can call to broadcast messages.
            notification.client.broadcastMessage = function (name, message) {
                $.Notify({ style: { background: '#1ba1e2', color: 'white' }, caption: 'Thông báo!', content: message });
            };

            $.connection.hub.start().done(function () {
            });
        });
    </script>
    <script>
        $(function () {
            var checkSession = $("#txtCheckSession").val();
            if (checkSession == "") {
                window.location.href = "/Home/Announcement";
            }
        });
    </script>
</body>
</html>
